public class Test {
    class Student implements Comparable{
        private String name;
        private int score;

        public Student(String name,int score) {  //Student构造方法
            this.name = name;
            this.score = score;
        }

        public String toString() {
            return "["+this.name+":"+this.score+"]";
        }

        public int compareTo(Object o) {
            Student s = (Student)o;
            if(this.score > s.score) {
                return -1;
            }else if(this.score < s.score) {
                return 1;
            }else {
                return 0;
            }
        }


    }

}



